<?php

namespace app\api\validate;

use think\Validate;

class WithdrawValidate extends Validate
{
    protected $regex = ['amount' => '/^[1-9]\d*|^[1-9]\d*.\d+[1-9]$/'];

    protected $rule = [
        'amount' => 'require|regex:amount',
        'type' => 'require|in:balance,redbag',
    ];

    protected $message = [
        'type.require' => '类型必须填写',
        'type.in' => '类型格式错误',
        'amount.require' => '提现金额不能为空',
        'amount.regex' => '提现金额格式错误',
    ];

    protected $scene = [
        'create' => ['amount', 'type'],
        'list' => [''],
        'detail' => ['type'],
    ];
}